The st_button_release() call wouldn't happen because StButton does not
set priv->button_mask on touch events. And if we make it called, we can't
try to unset the device grab at the end of the function, as device/sequence
are unset earlier on.
g_return_if_fail (ST_IS_BUTTON (button));
priv = st_button_get_instance_private (button);
- if (priv->pressed)
+ if (priv->device && priv->press_sequence)
+ {
+ clutter_input_device_sequence_ungrab (priv->device,
+ priv->press_sequence);
+ }
+
+ if (priv->pressed || priv->press_sequence)
st_button_release (button, priv->device,
priv->pressed, 0, NULL);
clutter_ungrab_pointer ();
}
- if (priv->device &&
- priv->press_sequence)
- {
- clutter_input_device_sequence_ungrab (priv->device,
- priv->press_sequence);
- priv->press_sequence = NULL;
- }
-
priv->device = NULL;
}